﻿
************************************************************************************************
* Constructing data set to "Public Health Policy At Scale.."
************************************************************************************************

************************************************************************************************
* Full population born 1970-2013 from birth registry
* include mortality
*************************************************************************************************


global rawStata "X:\Data\Workdata\707116\Stata"
global temp2 "X:\Data\Workdata\707116\ChildVax\02_temp\Nov2019" 

set mem 2g
set more off
set linesize 255

clear all

use $temp2\lpr1996.dta
append using $temp2\lpr2014.dta
bysort pnr: g j=_N 
drop if j>1
drop j
keep pnr byear 
tempfile t1 
save `t1' 

use $rawStata\DOD2017.dta, clear 
merge 1:1 pnr using `t1' 
tab byear _merge

keep if _merge==3 
g dead=1
rename doddato deathdate 
keep pnr dead deathdate 

save $temp2\mortality.dta, replace 
